package o;

import java.io.IOException;
import java.security.cert.Certificate;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;

public final class fuk {
    private final fuz ˊ;
    private final List<Certificate> ˋ;
    private final List<Certificate> ˎ;
    private final fub ॱ;

    private fuk(fuz o_fuz, fub o_fub, List<Certificate> list, List<Certificate> list2) {
        this.ˊ = o_fuz;
        this.ॱ = o_fub;
        this.ˋ = list;
        this.ˎ = list2;
    }

    public static fuk ॱ(SSLSession sSLSession) throws IOException {
        String cipherSuite = sSLSession.getCipherSuite();
        if (cipherSuite == null) {
            throw new IllegalStateException("cipherSuite == null");
        } else if ("SSL_NULL_WITH_NULL_NULL".equals(cipherSuite)) {
            throw new IOException("cipherSuite == SSL_NULL_WITH_NULL_NULL");
        } else {
            fub ˋ = fub.ˋ(cipherSuite);
            cipherSuite = sSLSession.getProtocol();
            if (cipherSuite == null) {
                throw new IllegalStateException("tlsVersion == null");
            } else if ("NONE".equals(cipherSuite)) {
                throw new IOException("tlsVersion == NONE");
            } else {
                Object[] peerCertificates;
                List ˋ2;
                List ˋ3;
                fuz ˋ4 = fuz.ˋ(cipherSuite);
                try {
                    peerCertificates = sSLSession.getPeerCertificates();
                } catch (SSLPeerUnverifiedException e) {
                    peerCertificates = null;
                }
                if (peerCertificates != null) {
                    ˋ2 = fvg.ˋ(peerCertificates);
                } else {
                    ˋ2 = Collections.emptyList();
                }
                Object[] localCertificates = sSLSession.getLocalCertificates();
                if (localCertificates != null) {
                    ˋ3 = fvg.ˋ(localCertificates);
                } else {
                    ˋ3 = Collections.emptyList();
                }
                return new fuk(ˋ4, ˋ, ˋ2, ˋ3);
            }
        }
    }

    public static fuk ˊ(fuz o_fuz, fub o_fub, List<Certificate> list, List<Certificate> list2) {
        if (o_fuz == null) {
            throw new NullPointerException("tlsVersion == null");
        } else if (o_fub != null) {
            return new fuk(o_fuz, o_fub, fvg.ˏ((List) list), fvg.ˏ((List) list2));
        } else {
            throw new NullPointerException("cipherSuite == null");
        }
    }

    public fuz ˋ() {
        return this.ˊ;
    }

    public fub ॱ() {
        return this.ॱ;
    }

    public List<Certificate> ˎ() {
        return this.ˋ;
    }

    public List<Certificate> ˊ() {
        return this.ˎ;
    }

    public boolean equals(@Nullable Object obj) {
        if (!(obj instanceof fuk)) {
            return false;
        }
        fuk o_fuk = (fuk) obj;
        if (this.ˊ.equals(o_fuk.ˊ) && this.ॱ.equals(o_fuk.ॱ) && this.ˋ.equals(o_fuk.ˋ) && this.ˎ.equals(o_fuk.ˎ)) {
            return true;
        }
        return false;
    }

    public int hashCode() {
        return ((((((this.ˊ.hashCode() + 527) * 31) + this.ॱ.hashCode()) * 31) + this.ˋ.hashCode()) * 31) + this.ˎ.hashCode();
    }
}
